<?php
namespace App\Api\Controllers;
use Common\ApiController;
class CallbackController extends ApiController
{
    public $params;
    public function initialize()
    {
//        parent::initialize();
        $postData = $this->request->getPost();
        $getData = $this->request->Get();
        if($postData && $getData){
            $this->params = array_merge($postData,$getData);
        }else{
            if($postData){
                $this->params = $postData;
            }else{
                $this->params = $getData;
            }
        }
        unset($this->params['_url']);
    }

    public function openYibaoCallbackAction(){
        $write       = json_encode($this->params);
        $write .= "-------------------------------------------------------------------------------------";
        $create_file = BASE_PATH."/cache/paylog/yibao.log";       //创建文件
        file_put_contents($create_file, $write, FILE_APPEND | LOCK_EX);
        echo "SUCCESS";
    }

}
